<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!-- 
	Copyright (C) 2007, 2008, 2009, 2010, 2011. PARP Research Group.
	<http://perception.inf.um.es>
	University of Murcia, Spain.

	This file is part of the QVision library.

	QVision is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as
	published by the Free Software Foundation, version 3 of the License.

	QVision is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with QVision. If not, see <http://www.gnu.org/licenses/>.
-->

<html><head><meta http-equiv="content-Type" content="text/html;charset=UTF-8">
<title>QVision: Qt&#39;s Image, Video and Computer Vision Library</title>
<meta name="title" content="QVision" />
<meta name="dc.title" content="QVision" />
<meta name="url" content="http://perception.inf.um.es/QVision" />
<meta name="author" content="PARP Research Group - http://perception.inf.um.es" />
<meta name="revisit-after" content="30 DAYS"/>
<meta name="robots" content="index,follow"/>
<meta name="classification" content="*">
<meta name="rating" content="Safe For Kids">
<meta name="distribution" content="GLOBAL"/>
<meta name="description" content="Qt's Image, Video and Computer Vision Library"/>
<meta name="page-topic" content="Computer Vision research and prototype programming"/>
<meta name="geo.country" content="ES" />

<!--
Keywords:
By license:		open source, gnu, lgpl, gpl, free
By theme:		computer vision, image processing, robotics, programming, source, development
By usage:		library, toolkit, framework, prototype, application
By programming specs:	object oriented, c++, block programming, reusability, gui, graphical, parallel computing, high performance, GPU, prototyping
Interoperability with:	Qt, GSL, GNU Scientific library, OpenCV, CGAL, QWT, CUDA, mplayer, IPP, Intel Image Performance Primitives, blas, lapack
Functionallity:		image features, matrix algebra, projective geometry, mser, function minimization, function optimization, canny operator, harris operator, corner detection, performance evaluation, cpu usage, graphical interface
Main data-types:	matrix, vector, tensor, quaternion, image, polyline
Video sources:		webcam, camera, stream
Devices:		embedded, desktop computer, laptop, mini-laptop
Authors:		PARP research group. University of Murcia, Spain.
-->

<meta name="keywords" content="augmented reality, sfm, structure from motion, open source, gnu, lgpl, gpl, free, computer vision, image processing, robotics, programming, source, development, library, toolkit, framework, prototype, application, object oriented, c++, block programming, reusability, gui, graphical, parallel computing, high performance, GPU, prototyping, Qt, GSL, GNU Scientific library, OpenCV, CGAL, QWT, CUDA, mplayer, IPP, Intel Image Performance Primitives, blas, lapack, image features, matrix algebra, projective geometry, mser, function minimization, function optimization, canny operator, harris operator, corner detection, performance evaluation, cpu usage, graphical interface, matrix, vector, tensor, quaternion, image, polyline, webcam, camera, stream, embedded, desktop computer, laptop, mini-laptop, University of Murcia, Spain, PARP research group, vision por computador"/>
<meta http-equiv="keywords" content="augmented reality, sfm, structure from motion, open source, gnu, lgpl, gpl, free, computer vision, image processing, robotics, programming, source, development, library, toolkit, framework, prototype, application, object oriented, c++, block programming, reusability, gui, graphical, parallel computing, high performance, GPU, prototyping, Qt, GSL, GNU Scientific library, OpenCV, CGAL, QWT, CUDA, mplayer, IPP, Intel Image Performance Primitives, blas, lapack, image features, matrix algebra, projective geometry, mser, function minimization, function optimization, canny operator, harris operator, corner detection, performance evaluation, cpu usage, graphical interface, matrix, vector, tensor, quaternion, image, polyline, webcam, camera, stream, embedded, desktop computer, laptop, mini-laptop, University of Murcia, Spain, PARP research group, vision por computador"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="title" content="QVision"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" />
</head><body>

<table width="100%"><tr>
	<td><a href="http://perception.inf.um.es/"><img src="parp.png" border="0" /> <big>PARP Research Group</big></a></td>
	<td align="right"><a href="http://www.um.es/"><big>Universidad de Murcia</big> <img src="um.png" border="0" /></a></td>
</tr></table>

<hr /><br />

<table width="95%" align="center"><tr><td>

<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
          <form id="FSearchBox" action="search.php" method="get">
            <img id="MSearchSelect" src="search/search.png" alt=""/>
            <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                   onfocus="searchBox.OnSearchFieldFocus(true)" 
                   onblur="searchBox.OnSearchFieldFocus(false)"/>
          </form>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>src/qvmath/qvtensor.h</h1><a href="qvtensor_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> *      Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012. PARP Research Group.</span>
<a name="l00003"></a>00003 <span class="comment"> *      &lt;http://perception.inf.um.es&gt;</span>
<a name="l00004"></a>00004 <span class="comment"> *      University of Murcia, Spain.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> *      This file is part of the QVision library.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> *      QVision is free software: you can redistribute it and/or modify</span>
<a name="l00009"></a>00009 <span class="comment"> *      it under the terms of the GNU Lesser General Public License as</span>
<a name="l00010"></a>00010 <span class="comment"> *      published by the Free Software Foundation, version 3 of the License.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> *      QVision is distributed in the hope that it will be useful,</span>
<a name="l00013"></a>00013 <span class="comment"> *      but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00014"></a>00014 <span class="comment"> *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00015"></a>00015 <span class="comment"> *      GNU Lesser General Public License for more details.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> *      You should have received a copy of the GNU Lesser General Public</span>
<a name="l00018"></a>00018 <span class="comment"> *      License along with QVision. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00019"></a>00019 <span class="comment"> */</span>
<a name="l00020"></a>00020 
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#ifndef QTENSOR_H</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define QTENSOR_H</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;<a class="code" href="qvblasdatabuffer_8h.html" title="File from the QVision library.">qvmath/qvblasdatabuffer.h</a>&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="qvtensorindexator_8h.html" title="File from the QVision library.">qvmath/qvtensorindexator.h</a>&gt;</span>
<a name="l00032"></a>00032 
<a name="l00234"></a><a class="code" href="classQVTensor.html">00234</a> <span class="keyword">class </span><a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a>
<a name="l00235"></a>00235     {
<a name="l00236"></a>00236     <span class="keyword">public</span>:
<a name="l00237"></a>00237         <span class="comment">// Constructors</span>
<a name="l00238"></a>00238 
<a name="l00242"></a><a class="code" href="classQVTensor.html#ad0190ee5a42114b381859e0045b9ba81">00242</a>         <a class="code" href="classQVTensor.html#ad0190ee5a42114b381859e0045b9ba81" title="Copy constructor.">QVTensor</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor): dataSize(tensor.dataSize), dims(tensor.dims), indexIds(tensor.indexIds), data(tensor.data)    { }
<a name="l00243"></a>00243 
<a name="l00250"></a><a class="code" href="classQVTensor.html#ab571f6752903ec1dea3c6d02be465e8b">00250</a>         <a class="code" href="classQVTensor.html#ad0190ee5a42114b381859e0045b9ba81" title="Copy constructor.">QVTensor</a>(<span class="keyword">const</span> QVTensorValence &amp;indexList = QVTensorValence()):
<a name="l00251"></a>00251             dataSize(1), dims(indexList.size()), indexIds(indexList.size())
<a name="l00252"></a>00252             {
<a name="l00253"></a>00253             <span class="keywordflow">for</span> (<span class="keywordtype">int</span> n = 0; n &lt; indexList.size(); n++)
<a name="l00254"></a>00254                 {
<a name="l00255"></a>00255                 indexIds[n] = indexList.at(n).id;
<a name="l00256"></a>00256                 dataSize *= (dims[n] = indexList.at(n).dim);
<a name="l00257"></a>00257                 }
<a name="l00258"></a>00258 
<a name="l00259"></a>00259             <span class="comment">// In the case of an empty valence, the tensor will be a scalar</span>
<a name="l00260"></a>00260             data = <span class="keyword">new</span> QBlasDataBuffer(dataSize);
<a name="l00261"></a>00261             }
<a name="l00262"></a>00262 
<a name="l00263"></a>00263         <span class="comment">// Operators</span>
<a name="l00264"></a>00264 
<a name="l00269"></a><a class="code" href="classQVTensor.html#a249f49d9b79a8ad78fbad1f2e2bb0ab3">00269</a>         <span class="keywordtype">bool</span> <a class="code" href="classQVTensor.html#a249f49d9b79a8ad78fbad1f2e2bb0ab3" title="Compare operator for tensors.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor)<span class="keyword"> const                   </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVTensor.html#a66f3349e05d25669238e817363af2829" title="Check equivalence between tensors.">equals</a>(tensor);                };
<a name="l00270"></a>00270 
<a name="l00275"></a><a class="code" href="classQVTensor.html#a30fc716cfb642e78bcae4e7cd9034ae0">00275</a>         <span class="keywordtype">bool</span> <a class="code" href="classQVTensor.html#a30fc716cfb642e78bcae4e7cd9034ae0" title="Compare operator for tensors.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor)<span class="keyword"> const                   </span>{ <span class="keywordflow">return</span> !<a class="code" href="classQVTensor.html#a66f3349e05d25669238e817363af2829" title="Check equivalence between tensors.">equals</a>(tensor);               };
<a name="l00276"></a>00276 
<a name="l00281"></a><a class="code" href="classQVTensor.html#adcd1d28addfdde5b6a8ff1c505a0a683">00281</a>         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#adcd1d28addfdde5b6a8ff1c505a0a683" title="Tensor product.">operator*</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor)<span class="keyword"> const                        </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVTensor.html#ac3ab1408a9ae9b32c01dca061d422ddf" title="Obtains the inner product of two tensors.">innerProduct</a>(tensor);  };
<a name="l00282"></a>00282 
<a name="l00287"></a><a class="code" href="classQVTensor.html#ae32eb60475bb040349887cde46400b87">00287</a>         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#ae32eb60475bb040349887cde46400b87" title="Tensor add.">operator+</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor)<span class="keyword"> const                        </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVTensor.html#ac1d43563ea2215db9d9e710cba7e0246" title="Tensor add.">add</a>(tensor);   };
<a name="l00288"></a>00288 
<a name="l00293"></a><a class="code" href="classQVTensor.html#a3c55a179607c3a3b44fa30645e7e5aa4">00293</a>         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a3c55a179607c3a3b44fa30645e7e5aa4" title="Tensor substraction.">operator-</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor)<span class="keyword"> const                        </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVTensor.html#a9c310f3902d33a4572b36147b887a3a5" title="Tensor substraction.">substract</a>(tensor);     };
<a name="l00294"></a>00294 
<a name="l00298"></a><a class="code" href="classQVTensor.html#a3450723305be6b30517ae483b4059a2a">00298</a>         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a3450723305be6b30517ae483b4059a2a" title="Outer product.">operator^</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor)<span class="keyword"> const                        </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVTensor.html#a5fca8e41cab78d5f664b33dc355abbb9" title="Obtains the outer product of two tensors.">outerProduct</a>(tensor);          };
<a name="l00299"></a>00299 
<a name="l00304"></a><a class="code" href="classQVTensor.html#a5b1ed4d9d7b11992e04c1d2a9eabeae6">00304</a>         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a5b1ed4d9d7b11992e04c1d2a9eabeae6" title="Index renaming and contracting operator.">operator()</a>(<span class="keyword">const</span> QVTensorValence &amp;indexList)<span class="keyword"> const     </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVTensor.html#afce34958c46236f2332c04c886d54333" title="Index renaming and contracting.">renameIndexes</a>(indexList);      };
<a name="l00305"></a>00305 
<a name="l00306"></a>00306         <span class="comment">// Operation methods</span>
<a name="l00307"></a>00307 
<a name="l00312"></a><a class="code" href="classQVTensor.html#aaf731ea26d29371aedf67e02a1f47983">00312</a>         <span class="keywordtype">int</span> <a class="code" href="classQVTensor.html#aaf731ea26d29371aedf67e02a1f47983" title="Gets the size of the data array.">getDataSize</a>()<span class="keyword">                       const   </span>{ <span class="keywordflow">return</span> dataSize; }
<a name="l00313"></a>00313 
<a name="l00317"></a><a class="code" href="classQVTensor.html#a9e75752b76652d2a1ebc64dbc5d0df49">00317</a>         <span class="keyword">const</span> <span class="keywordtype">double</span> *<a class="code" href="classQVTensor.html#a9e75752b76652d2a1ebc64dbc5d0df49" title="Gets a read-only reference to the data buffer of the tensor.">getReadData</a>()<span class="keyword">             const   </span>{ <span class="keywordflow">return</span> data-&gt;getReadData(); }
<a name="l00318"></a>00318 
<a name="l00322"></a><a class="code" href="classQVTensor.html#a9d5c2f2d4fd11123354d7568400d2b8e">00322</a>         <span class="keywordtype">double</span> *<a class="code" href="classQVTensor.html#a9d5c2f2d4fd11123354d7568400d2b8e" title="Gets a reference of the data buffer of the tensor for read and write accesses.">getWriteData</a>()                          { <span class="keywordflow">return</span> data-&gt;getWriteData(); }
<a name="l00323"></a>00323 
<a name="l00328"></a>00328         QVTensorValence <a class="code" href="classQVTensor.html#ada0f3000987c85bbaaa3c02e4b69aada" title="Gets valence of the tensor.">getValence</a>() <span class="keyword">const</span>;
<a name="l00329"></a>00329 
<a name="l00337"></a>00337         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#abeec4ea63ea5cac0bec9985b89d6c11b" title="Get a subtensor from a tensor.">slice</a>(<span class="keyword">const</span> QVTensorIndexValues &amp;indexRangeList) <span class="keyword">const</span>;
<a name="l00338"></a>00338 
<a name="l00345"></a>00345         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a6ca73279da9ca3a3914d385faeac0ccd" title="Change the order of the indexes in the tensor.">transpose</a>(<span class="keyword">const</span> QVTensorValence &amp;indexList) <span class="keyword">const</span>;
<a name="l00346"></a>00346 
<a name="l00352"></a>00352         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a6ca73279da9ca3a3914d385faeac0ccd" title="Change the order of the indexes in the tensor.">transpose</a>(<span class="keyword">const</span> <a class="code" href="classQVTensorIndex.html" title="Indexes for tensors.">QVTensorIndex</a> &amp;i, <span class="keyword">const</span> <a class="code" href="classQVTensorIndex.html" title="Indexes for tensors.">QVTensorIndex</a> &amp;j) <span class="keyword">const</span>;
<a name="l00353"></a>00353 
<a name="l00358"></a>00358         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#ac1d43563ea2215db9d9e710cba7e0246" title="Tensor add.">add</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor) <span class="keyword">const</span>;
<a name="l00359"></a>00359 
<a name="l00364"></a>00364         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a9c310f3902d33a4572b36147b887a3a5" title="Tensor substraction.">substract</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor) <span class="keyword">const</span>;
<a name="l00365"></a>00365 
<a name="l00372"></a>00372         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a05457fb8f5a27bd8dfa0fb960b306d4a" title="Obtains the tensor product of two tensors.">tensorProduct</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor) <span class="keyword">const</span>;
<a name="l00373"></a>00373 
<a name="l00379"></a>00379         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#ac3ab1408a9ae9b32c01dca061d422ddf" title="Obtains the inner product of two tensors.">innerProduct</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor) <span class="keyword">const</span>;
<a name="l00380"></a>00380 
<a name="l00386"></a>00386         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a5fca8e41cab78d5f664b33dc355abbb9" title="Obtains the outer product of two tensors.">outerProduct</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor) <span class="keyword">const</span>;
<a name="l00387"></a>00387 
<a name="l00393"></a>00393         <span class="keywordtype">bool</span> <a class="code" href="classQVTensor.html#a66f3349e05d25669238e817363af2829" title="Check equivalence between tensors.">equals</a>(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor) <span class="keyword">const</span>;
<a name="l00394"></a>00394 
<a name="l00401"></a>00401         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#afce34958c46236f2332c04c886d54333" title="Index renaming and contracting.">renameIndexes</a>(<span class="keyword">const</span> QVTensorValence &amp;indexList) <span class="keyword">const</span>;
<a name="l00402"></a>00402 
<a name="l00409"></a><a class="code" href="classQVTensor.html#a1b856e5e538e752255d0d49e8509dd66">00409</a>         QVTensorIndexator <a class="code" href="classQVTensor.html#a1b856e5e538e752255d0d49e8509dd66" title="Gets tensor indexator.">getIndexator</a>()        { <span class="keywordflow">return</span> QVTensorIndexator(dims); };
<a name="l00410"></a>00410 
<a name="l00414"></a>00414         <span class="keywordtype">double</span> <a class="code" href="classQVTensor.html#a01609a689d7a7e22092968f45eaaba97" title="Gets the norm2 for tensor.">norm2</a>() <span class="keyword">const</span>;
<a name="l00415"></a>00415 
<a name="l00420"></a>00420         <span class="keyword">static</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a9f0d229103588fb0bbbd32676a66888e" title="Gets Levi Civita symbol tensor.">leviCivita</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> dimension);
<a name="l00421"></a>00421 
<a name="l00422"></a>00422 <span class="preprocessor">        #ifndef DOXYGEN_IGNORE_THIS</span>
<a name="l00423"></a>00423 <span class="preprocessor"></span>        <span class="comment">// These methods won&#39;t be documented, but will be available for testing purposes</span>
<a name="l00424"></a>00424         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> contract() <span class="keyword">const</span>;
<a name="l00425"></a>00425 <span class="preprocessor">        #endif</span>
<a name="l00426"></a>00426 <span class="preprocessor"></span>
<a name="l00427"></a>00427     <span class="keyword">private</span>:
<a name="l00428"></a>00428         <span class="keyword">friend</span> std::ostream&amp; operator &lt;&lt; ( std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor );
<a name="l00429"></a>00429 
<a name="l00430"></a>00430         <span class="comment">// These should be private</span>
<a name="l00431"></a>00431         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a6ca73279da9ca3a3914d385faeac0ccd" title="Change the order of the indexes in the tensor.">transpose</a>(<span class="keyword">const</span> QVector&lt;int&gt; &amp;sorting) <span class="keyword">const</span>;
<a name="l00432"></a>00432         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> <a class="code" href="classQVTensor.html#a6ca73279da9ca3a3914d385faeac0ccd" title="Change the order of the indexes in the tensor.">transpose</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> index1Position, <span class="keyword">const</span> <span class="keywordtype">int</span> index2Position) <span class="keyword">const</span>;
<a name="l00433"></a>00433         <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> antisymmetrization(<span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor) <span class="keyword">const</span>;
<a name="l00434"></a>00434 
<a name="l00435"></a>00435         <span class="comment">// Tensor data</span>
<a name="l00436"></a>00436         <span class="keywordtype">int</span> dataSize;
<a name="l00437"></a>00437         QVector &lt;int&gt; dims;
<a name="l00438"></a>00438         QVector &lt;int&gt; indexIds;
<a name="l00439"></a>00439         QSharedDataPointer&lt; QBlasDataBuffer &gt; data;
<a name="l00440"></a>00440     };
<a name="l00441"></a>00441 
<a name="l00442"></a>00442 std::ostream&amp; operator &lt;&lt; ( std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classQVTensor.html" title="Implementation of tensors, a generalization for matrices and vectors.">QVTensor</a> &amp;tensor );
<a name="l00443"></a>00443 
<a name="l00444"></a>00444 <span class="comment">//Q_DECLARE_METATYPE(QVTensor);</span>
<a name="l00445"></a>00445 
<a name="l00446"></a>00446 <span class="preprocessor">#endif</span>
</pre></div></div>
</td></tr></table>

<br /><hr><br />
<center><a href="http://perception.inf.um.es/QVision">QVision framework</a>.
<a href="http://perception.inf.um.es">PARP research group</a>.
Copyright &copy; 2007, 2008, 2009, 2010, 2011.</center>
<br />
</body>
</html>
